#ifndef frm_control_test_H
#define frm_control_test_H

#include "frm_control_TPanel.h"
#include "frm_TMenu.h"

namespace frm { namespace control { namespace test {

///////////////////////////////////////////////////////////////////////////////

struct TCommand1 : public svl::TCommand
{
  TCommand1() { Caption = "TCommand1"; }
  virtual void TCommand_Execute() { ::MessageBeep(0); }//svl::TMessageModal("TCommand1"); }
};
struct TCommand2 : public svl::TCommand
{
  TCommand2() { Caption = "TCommand2"; }
  virtual void TCommand_Execute() { svl::TMessageModal("TCommand2"); }
};

///////////////////////////////////////////////////////////////////////////////

struct TPanelA : public control::TPanel
{
  struct TStyle : public frm::TDebug
  {
    TPanel::TStyle Normal,MouseEnter;
  };
  bool EnFocus,EnScroll;
  //
  TPanelA(TWindow &Window) : TPanel(Window) { EnFocus = true; EnScroll = false; static TStyle Style; SetStyle(Style); }
 ~TPanelA() {}
  //
  void SetStyle(TStyle &Style) { style = &Style; TPanel::SetStyle(Style.Normal); }

protected:
  virtual void TComponent_Paint(TPaint &Paint,int NPaintStack);
  //
  virtual void TComponent_MouseEnter();
  virtual void TComponent_MouseExit ();
  //
  virtual void TComponent_FocusEnter();
  virtual void TComponent_FocusExit ();
  //
  virtual void TComponent_Mouse(TMouse Mouse);
  virtual bool TComponent_FocusEnable() { return EnFocus;}
  virtual void TComponent_SetCaretByX  (TGeometryRect &GRect,int XClient);
  virtual void TComponent_SetCaretByPos(TGeometryRect &GRect,int Pos);
  //
  virtual void TComponent_KeyboardKey(grf::TKeyboardKey &KeyboardKey);
  //
  virtual void TComponent_MouseWheel(TMouseWheel MouseWheel);
  
private:
  TStyle *style;
};

///////////////////////////////////////////////////////////////////////////////

struct TPanelWin : public control::TPanel , public grf::TWindow
{
  filler::TFiller Filler;
  cursor::TCursor Cursor;
  //
  TPanelWin(control::TWindow &Window);

protected:
  virtual void TComponent_Paint(TPaint &Paint,int NPaintStack);
  virtual void TWindow_Paint(grf::TPaint &Paint);
  virtual void TWindow_Mouse(grf::TMouse &Mouse);
};

///////////////////////////////////////////////////////////////////////////////

struct TWindowTest : public TWindow
{
  TWindowTest();
  //
  TMainMenu mainMenu;
};

///////////////////////////////////////////////////////////////////////////////
void Test();
///////////////////////////////////////////////////////////////////////////////
}}}

#endif
